import { request } from 'umi';

import APIS from '@/services/apis';
export async function getOrderManageList(params: any) {
  return request(APIS.GetUserOrders, {
    method: 'POST',
    data: params,
  });
}
export async function getValidOrderProductInfo() {
  return request(APIS.ValidOrderProductInfo, {
    method: 'GET',
  });
}
export async function addOrder(params: any) {
  return request(APIS.AddOrder, {
    method: 'POST',
    data: params,
  });
}
export async function payMoney(params: any) {
  return request(APIS.PayUrl, {
    method: 'POST',
    data: params,
  });
}
export async function wechatPay(params: any) {
  return request(APIS.WechatPayUrl, {
    method: 'POST',
    data: params,
  });
}
export async function paymentCallBack(params: any) {
  return request(APIS.PaymentCallBack, {
    method: 'POST',
    data: params,
  });
}
// 已经购买的产品
export async function buyedProducts() {
  return request(APIS.BuyedProducts, {
    method: 'POST',
  });
}
// 取消订单
export async function cancelOrderAction(params: string) {
  return request(`/api/SaasOrder/CancelOrder?id=${params}`, {
    method: 'POST',
  });
}

// 新增产线更新信息
export async function updateInfo(params: any) {
  return request(`/api/SaasUser/UpdateCorpInfo`, {
    method: 'POST',
    data: params,
  });
}
export async function forWechatPay(id: string) {
  return request(`/api/Trade/PayQuery/${id}`, {
    method: 'GET',
  });
}
// 计算新增产线价格
export async function calculateOrderAmount(params: any) {
  return request(APIS.CalculateOrderAmount, {
    method: 'POST',
    data: params,
  });
}
// 开发票
export async function drawBill(params: any) {
  return request(APIS.DrawBill, {
    method: 'POST',
    data: params,
  });
}
export async function applyContract(params: any) {
  return request(APIS.ApplyContract, {
    method: 'POST',
    data: params,
  });
}
export async function getAllDocx(params: number) {
  return request(`/api/SaasAgreement/GetAgreement/${params}`, {
    method: 'GET',
  });
}
